﻿@page
@model RazorStudentManager.Pages.ClassPage.IndexModel

@{
    ViewData["Title"] = "Index";
}

<h1 class="text-info">Index</h1>

<p>
    <a asp-page="Create" class="btn btn-primary">Create New</a>
</p>
<table class="table table-hover">
    <thead class="thead-light">
        <tr>
            <th scope="col">
                @Html.DisplayNameFor(model => model.StudentClass[0].ClassName)
            </th>
            <th scope="col">
                操作
            </th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model.StudentClass) {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.ClassName)
                </td>
                <td>
                    <a class="btn btn-outline-success" asp-page="./Edit" asp-route-id="@item.Id">Edit</a> |
                    <a class="btn btn-outline-info" asp-page="./Details" asp-route-id="@item.Id">Details</a> |
                    <a class="btn btn-outline-danger" asp-page="./Delete" asp-route-id="@item.Id">Delete</a>
                </td>
            </tr>
        }
    </tbody>
</table>
